package com.bauer.base.collection;

import java.util.ArrayList;
import java.util.List;

public class MyArrayList<T> implements MyList<T> {

    private Object[] list;

    private int capacity;

    private int size;

    public MyArrayList() {
        this.list = new Object[10];

    }

    public MyArrayList(int capacity) {
        this.capacity = capacity;
        list = new Object[capacity];
    }

    @Override
    public void add(T obj) {
        if (size >= capacity) {

        }
        size++;
    }

    @Override
    public int size() {
        return this.size;
    }

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add(null);
        list.add(null);
        for (String str : list) {
            System.out.println(str);
        }
    }
}
